<ion-view view-title="易联锁" hide-back-button="true" show-tabs="true">

  <ion-content class="has-tabs">

    <section class="light royal-bg text-center now-sell">

      <div class="bar bar-royal block-title">
      <h5 class="light">
        <span ng-if="saleAnalytics.loaded">今日实时销售</span>
        <ion-spinner icon="lines" ng-if="!saleAnalytics.loaded" class="spinner-light"></ion-spinner>
      </h5>
        <a class="button button-icon icon ion-ios-more pull-right" href="#/sale"></a>
      </div>
      <div>
        <h1 class="light" ng-show="saleAnalytics.loaded">{{saleAnalytics.totalSale | currency:'￥' | numFormat:true}} <small>/ {{saleAnalytics.orderCount}} 单</small></h1>
        <div class="attenuated">销售额</div>
      </div>

      <div class="row">
        <div class="col">
          <h3 class="light" ng-show="saleAnalytics.loaded">{{saleAnalytics.totalMargin | currency:'￥' | numFormat:true}} </h3>
          <div class="attenuated">毛利</div>
        </div>

        <div class="col">
          <h3 class="light" ng-show="saleAnalytics.loaded">{{saleAnalytics.totalMarginRatio+'%'}}</h3>
          <div class="attenuated">毛利率</div>
        </div>
      </div>
    </section>

    <ion-item class="inventory-alarm item-icon-left item-icon-right" ng-href="#/inventory/{{inventoryStatus.alarmHref}}" ng-class="{'balanced':inventoryStatus.stat=='1','royal':inventoryStatus.stat=='2','assertive':inventoryStatus.stat=='3'}">
      <i class="icon ion-android-warning icon-label"></i>
      库存总览
      <span class="item-note">{{inventoryStatus.statInfo}}</span>
      <i class="icon dark2 ion-ios-arrow-right"></i>
    </ion-item>

    <section class="grid wrap-light">
      <div class="row row-center">
        <a class="col grid-item" href="#/base-data"><i class="icon ion-ios-gear calm"></i>基础信息</a>
        <a class="col grid-item" href="#/im/notice"><i class="icon ion-ios-chatboxes royal"></i>发布通知</a>
        <a class="col grid-item" href="#/products"><i class="icon ion-ios-box positive"></i>管理商品</a>
        <a class="col grid-item" href="#/suppliers"><i class="icon ion-person balanced"></i>供应商</a>
      </div>
      <div class="row row-center">
        <a class="col grid-item" href="#/inventory"><i class="icon ion-social-buffer calm"></i>库存查询</a>
        <a class="col grid-item" href="#purchase/create-order"><i class="icon ion-ios-download royal"></i>进货</a>
        <a class="col grid-item" href="#/sale"><i class="icon ion-pie-graph positive"></i>销售统计</a>
      </div>
    </section>
    <section class="padding block wrap-light news">
      <header class="">
        <h4><i class="balanced icon-left ion-ios-bookmarks-outline"></i> 业内资讯</h4>
      </header>
      <ion-spinner icon="lines" ng-if="!items.length" class="spinner-royal fade_height"></ion-spinner>
      <div class="list-borderbottom">
        <a ng-repeat="item in items" class="item" ng-class="{'item-thumbnail-left':item.image}" href="#/news/{{$index + 1}}">
          <img ng-src="{{ item.image }}" ng-if="item.image">
          <h2>{{ item.title }}</h2>
          <p class="meta"><time>{{ item.pubDate | date:'yyyy-MM-dd' }}</time><span>{{ item.source }}</span> <span>{{ item.creator }}</span></p>
          <p class="description">{{item.description | delHtmlTag : 'html' | limitTo : 50 }}</p>
        </a>

      </div>
    </section>

  </ion-content>
</ion-view>
